<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:fb="http://www.facebook.com/2008/fbml">

<sec:ifLoggedIn>
	<g:render template="/common/addTokenPopup" />
</sec:ifLoggedIn>
<sec:ifNotLoggedIn>
	<!-- Modal panel.Rendered only if the user is not logged in -->
	<g:render template="/login/simpleLogin" />
</sec:ifNotLoggedIn>

<!-- Header bar -->
<div class="navbar navbar-inverse navbar-fixed-top" style="margin-bottom: 0px;">
	<div class="navbar-inner">
		<div class="container">
			<a class="btn btn-navbar" data-toggle="collapse"
				data-target=".nav-collapse"> <span class="icon-bar"></span> <span
				class="icon-bar"></span> <span class="icon-bar"></span>
			</a>
			<g:link class="brand" url="/">
				<g:message code="photo_admin.title" />
			</g:link>
			<div class="nav-collapse collapse">
				<ul class="nav">
										
					<li><g:link  controller="index" action="contactUs" ><g:message code="contact" /></g:link></a></li>
					
					<sec:ifLoggedIn>
						<li><g:link  controller="index" action="about" ><g:message code="about" /></g:link></li>
					
						<li class="dropdown"><a href="#" class="dropdown-toggle"
							data-toggle="dropdown"><g:message code="actions" /> <b class="caret"></b></a>
							<ul class="dropdown-menu">
								
								<li><a href="${createLink(controller: 'event', action: 'list')}"><g:message code="events" /></a></li>
							
								<sec:ifAnyGranted roles="ROLE_USER, ROLE_CLIENT">
									<li><a href="${createLink(controller: 'shoppingCart', action: 'show')}"><g:message code="cart" /></a></li>
								</sec:ifAnyGranted>
							
								<sec:ifAnyGranted roles="ROLE_PHOTOGRAPHER, ROLE_USER, ROLE_CLIENT">
									<li><a href="${createLink(controller: 'purchaseOrder', action: 'index')}"><g:message code="orders" /></a></li>
								</sec:ifAnyGranted>
								
								<sec:ifAnyGranted roles="ROLE_PHOTOGRAPHER, ROLE_CLIENT">
									<li><a href="${createLink(controller: 'eventAlbumToken', action: 'index')}"> <g:message code="share" /></a></li>
								</sec:ifAnyGranted>
								
								<sec:ifAnyGranted roles="ROLE_PHOTOGRAPHER, ROLE_CLIENT, ROLE_USER">
									<li><a href="#" data-toggle="modal" data-target="#addTokenModal"><g:message code="add.events" /></a></li>
								</sec:ifAnyGranted>
								
								<li class="divider"></li>
								
								<sec:ifAnyGranted roles="ROLE_PHOTOGRAPHER">
									<li><a href="#"> <g:message code="storage" /></a></li>
									<li><a href="#"> <g:message code="statistics" /></a></li>
									<li><a href="#"> <g:message code="portfolio" /></a></li>
									<li><a href="#"> <g:message code="prints" /></a></li>
								</sec:ifAnyGranted>
							</ul>
						</li>
					</sec:ifLoggedIn>
				</ul>

				<div class="navbar-form pull-right">
					<div class="fr">
						<sec:ifLoggedIn>
							<div class="btn-group">
								<button id="dropdownLoggedInUser"
									class="btn btn-success dropdown-toggle" data-toggle="dropdown">
									<sec:username />
									<span class="caret"></span>
								</button>
								<ul class="dropdown-menu">
									<li>
										<g:link controller="user" action="show">
											<g:message code="user.profile.view" />
										</g:link>
									</li>
									<li>
										<g:link controller="notificationsConfiguration" action="configuration">
											<g:message code="notifications" />
										</g:link>
									</li>

									<sec:ifAnyGranted roles="ROLE_PHOTOGRAPHER">
										<li><g:link controller="photographerConfiguration"
												action="configuration">
												<g:message code="photographer.configuration.view"
													default="Configuracion" />
											</g:link></li>
									</sec:ifAnyGranted>

									<sec:ifAnyGranted roles="ROLE_PHOTOGRAPHER">
										<li><g:link controller="photographerDiscount"
												action="configuration">
												<g:message code="photographer.discount.view"
													default="Promociones" />
											</g:link></li>
									</sec:ifAnyGranted>

									<li class="divider"></li>
									<li><a id="logoutButton" data-toggle="modal"
										href="${createLink(controller: 'logout', action: 'index')}"><g:message
												code="auth.logout" /></a></li>
								</ul>
							</div>
						</sec:ifLoggedIn>

						<sec:ifNotLoggedIn>
							<a id="enterSiteButton" data-toggle="modal"
								href="#simpleLoginModal" class="btn btn-success"><g:message
									code="auth.login" /></a>
						</sec:ifNotLoggedIn>
					</div>
					<sec:ifLoggedIn>
						<div id="shoppingCartImage" class="fr" style="margin-right: 8px;">
							<a href="${createLink(controller: 'shoppingCart', action: 'show')}">
								<g:imageCart />
							</a>
						</div>
						<div class="fr" style="margin-right: 8px;">
							
							<a href="${createLink(controller: 'notification', action: 'list')}">
								<g:imageNotifications></g:imageNotifications>
							</a>
						</div>
					</sec:ifLoggedIn>
				</div>
			</div>
		</div>
	</div>
</div>
</html>